/*
 * @Description: 详情弹框
 * @Author: ZhangHan
 * @Date: 2025-05-07 14:10:24
 * @LastEditTime: 2025-05-16 11:47:30
 * @LastEditors: ZhangHan
 */
import { ProModal } from "@/components/ProComponents";
import { Descriptions } from 'antd';
import { getDetailItems } from './detailSchema';

interface DetailModalProps {
  modalProps: any;
  onCancel: () => void;
  onOk?: () => void;
}

const DetailModal = ({ modalProps, onCancel, onOk }: DetailModalProps) => {
  const renderUserContent = (record: any) => {
    if (!record) return <div>加载中...</div>;
    return (
      <Descriptions bordered column={2} items={getDetailItems(record)} />
    );
  };

  return (
    <ProModal
      {...modalProps}
      renderContent={renderUserContent}
      onCancel={onCancel}
      onOk={onOk || onCancel}
      width={700}

    />
  );
};

export default DetailModal;
